package api

import (
	"go-project/common/base/resp"
	"go-project/common/middleware"
	"go-project/internal/model"

	"github.com/gin-gonic/gin"
)

type testApi struct{}

var TestApi = new(testApi)

func (api *testApi) Route(hs *gin.RouterGroup) {
	g := hs.Group("/test")
	{
		g.GET("", api.page)
	}
}

func (api *testApi) page(c *gin.Context) {
	query := new(model.TestQuery)
	if err := c.BindQuery(query); err != nil {
		resp.BadRequest(c, err.Error())
		return
	}
	user := middleware.GetUser(c)
	resp.OkWith(c, user)
	//TODO...
}
